#!/usr/bin/env python
#
#       Weapons.py
#       
#       Copyright 2009 Pete Lord <mr.petelord@gmail.com>
#       Copyright 2009 Ben Davis <its.hip@gmail.com>
#       
#       This program is free software; you can redistribute it and/or modify
#       it under the terms of the GNU General Public License as published by
#       the Free Software Foundation; either version 2 of the License, or
#       (at your option) any later version.
#       
#       This program is distributed in the hope that it will be useful,
#       but WITHOUT ANY WARRANTY; without even the implied warranty of
#       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#       GNU General Public License for more details.
#       
#       You should have received a copy of the GNU General Public License
#       along with this program; if not, write to the Free Software
#       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
#       MA 02110-1301, USA.

class PawnCannonA():
    """ Diagonally forward firing on both sides. """
    def __init__(self):
        self.max_damage = 2 # obvious
        self.min_damage = 1 # "
        self.crt_damage = 3 # critical hit damage
    
        self.to_hit = 8 # 8/12.  2/3 basically.
        
        self.gun = True # hit the first thing it encounters?
        
        self.steam = 2
        
        self.recoil = 8 # amount
        self.recoil_direction = 4 # backwards
        self.icon = "CannonA"
        
        # this example is as follows below, with S as ship and slashes as arcs of fire.
        """
        \+++++/
        +\+++/+
        ++\+/++
        +++S+++
        +++++++
        
        """
        self.targets = (((-1, 1), (-2, 2), (-3, 3), (-4, 4)),\
                        (( 1, 1), ( 2, 2), ( 3, 3), ( 4, 4)))
        # define coordinates relative to the ship to attack. tuples a tuple.
        # if the weapon only has on arc of fire / is aoe self.gun needs to be false.
        # otherwise each tuple in the overall tuple will be considered as a path of weapon fire.
        
        
class PawnCannonB():
    """ Firing to each side. """
    def __init__(self):
        self.max_damage = 3 # obvious
        self.min_damage = 2 # "
        self.crt_damage = 4 # critical hit damage
    
        self.to_hit = 9 # 9/12.  2/3 basically. well a little above.
        
        self.gun = True # hit the first thing it encounters?
        
        self.steam = 3
        
        self.recoil = 6
        self.recoil_direction = 4
        self.icon = "CannonB"
        
        # this example is as follows below, with S as ship and dashes as arcs of fire.
        """
        
        +++++++++
        +---S---+
        +++++++++
        
        """
        self.targets = (((-1, 0), (-2, 0), (-3, 0), (-4, 0)),\
                        (( 1, 0), ( 2, 0), ( 3, 0), ( 4, 0)))
        # define coordinates relative to the ship to attack. tuples a tuple.
        # if the weapon only has on arc of fire / is aoe self.gun needs to be false.
        # otherwise each tuple in the overall tuple will be considered as a path of weapon fire.

        
class KingCannonW():
    """ Water cannon forward to push enemies away, +damage """
    def __init__(self):
        self.max_damage = 4 # obvious
        self.min_damage = 2 # "
        self.crt_damage = 5 # critical hit damage
    
        self.to_hit = 10 # /12. 
        
        self.gun = False # hit the first thing it encounters?
        
        self.steam = 3
        
        self.recoil = 2
        self.recoil_direction = 4
        
        self.icon = "KingCannonW"
        
        """
        ++x++
        ++|++
        ++S++
        +++++
        
        """
        self.targets = (((0, 1), (0, 2)),\
                        (( 0, -1), ( 0, -2)))
        #Apparently we cannot just shoot one thing, must be two? Maybe I didn't undestand. (R)


class KingCannonS():
    """ Firing short-range at all compass points """
    def __init__(self):
        self.max_damage = 5 # obvious
        self.min_damage = 2 # "
        self.crt_damage = 7 # critical hit damage
    
        self.to_hit = 9 # 9/12 = 3/4 XD
        
        self.gun = True
        
        self.steam = 5
        
        self.recoil = 0
        self.recoil_direction = 0
        
        self.icon = "KingCannonS"
        
        """
        ++\+|+/++
        +++\|/+++
        ++--S--++
        +++/|\+++
        ++/+|+\++
        
        """
        self.targets = (((-1,  0), (-2,  0)), ((-1, -1), (-2, -2)),\
                        (( 0, -1), ( 0, -2)), (( 1, -1), ( 2, -2)),\
                        (( 1,  0), ( 2,  0)), (( 1,  1), ( 2, 2)),\
                        (( 0,  1), ( 0,  2)), ((-1,  1), (-2, 2)),\
                        )

